home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume3 / awm2 / part10 < prev    next >
Encoding:
Internet Message Format  |  1989-02-21  |  55.6 KB

  1. Path: uunet!lll-winken!ames!vsi1!wyse!mikew
  2. From: mikew@wyse.wyse.com (Mike Wexler)
  3. Newsgroups: comp.sources.x
  4. Subject: v03i026:  Ardent Window Manager, Patchlevel 9, Part10/12
  5. Message-ID: <2076@wyse.wyse.com>
  6. Date: 21 Feb 89 18:13:03 GMT
  7. Organization: Wyse Technology, San Jose
  8. Lines: 1788
  9. Approved: mikew@wyse.com
  10.  
  11. Submitted-by: kmw@ardent (Ken Wallich)
  12. Posting-number: Volume 3, Issue 26
  13. Archive-name: awm2/part10
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 10 (of 12)."
  22. # Contents:  Bindings.c Error.c Focus.c Menu.c Raise.c Refresh.c
  23. #   Restart.c StoreZap.c bitmaps/xterm.bm exp_path.c menus/dbug.h
  24. #   menus/eventsave.c twm.awmrc
  25. # Wrapped by mikew@wyse on Fri Feb 17 10:50:33 1989
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'Bindings.c' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'Bindings.c'\"
  29. else
  30. echo shar: Extracting \"'Bindings.c'\" \(3728 characters\)
  31. sed "s/^X//" >'Bindings.c' <<'END_OF_FILE'
  32. X
  33. X
  34. X
  35. X#ifndef lint
  36. Xstatic char *rcsid_Bindings_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Bindings.c,v 1.1 89/01/23 15:33:56 jkh Exp $";
  37. X#endif    lint
  38. X
  39. X#include "X11/copyright.h"
  40. X/*
  41. X *
  42. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  43. X *
  44. X * Copyright 1987 by Jordan Hubbard.
  45. X *
  46. X *
  47. X *                         All Rights Reserved
  48. X *
  49. X * Permission to use, copy, modify, and distribute this software and its
  50. X * documentation for any purpose and without fee is hereby granted,
  51. X * provided that the above copyright notice appear in all copies and that
  52. X * both that copyright notice and this permission notice appear in
  53. X * supporting documentation, and that the name of Ardent Computer
  54. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  55. X * pertaining to distribution of the software without specific, written
  56. X * prior permission.
  57. X *
  58. X */
  59. X
  60. X/*
  61. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  62. X *
  63. X *                         All Rights Reserved
  64. X *
  65. X * Permission to use, copy, modify, and distribute this software and its
  66. X * documentation for any purpose and without fee is hereby granted,
  67. X * provided that the above copyright notice appear in all copies and that
  68. X * both that copyright notice and this permission notice appear in
  69. X * supporting documentation, and that the name of Digital Equipment
  70. X * Corporation not be used in advertising or publicity pertaining to
  71. X * distribution of the software without specific, written prior permission.
  72. X *
  73. X *
  74. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  75. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  76. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  77. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  78. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  79. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  80. X * SOFTWARE.
  81. X */
  82. X
  83. X
  84. X
  85. X/*
  86. X * MODIFICATION HISTORY
  87. X *
  88. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  89. X */
  90. X
  91. X#ifndef lint
  92. Xstatic char *sccsid = "@(#)Bindings.c    3.8    1/24/86";
  93. X#endif
  94. X
  95. X/*
  96. X * Bindings.c     Default bindings for the X window manager 'awm'
  97. X *
  98. X * Note: Any changes to this file should also be added to the file
  99. X * /usr/new/lib/X/awm/default.awmrc to keep users informed as to the bindings
  100. X * contained herein.
  101. X */
  102. X
  103. Xchar *DefaultBindings[] = {
  104. X"menu=\"WindowOps\"{",
  105. X"New Window:!\"xterm&\"",
  106. X"RefreshScreen:f.refresh",
  107. X"Redraw:f.redraw",
  108. X"Move:f.move",
  109. X"Resize:f.resize",
  110. X"Lower:f.lower",
  111. X"Raise:f.raise",
  112. X"CircUp:f.circleup",
  113. X"CircDown:f.circledown",
  114. X"AutoIconify:f.iconify",
  115. X"LowerIconify:f.newiconify",
  116. X"NewIconify:f.newiconify",
  117. X"Focus:f.focus",
  118. X"Freeze:f.pause",
  119. X"UnFreeze:f.continue",
  120. X"Restart:f.restart",
  121. X"}",
  122. X"menu=\"Preferences\"{",
  123. X"Bell Loud:!\"xset b 7&\"",
  124. X"Bell Normal:!\"xset b 3&\"",
  125. X"Bell Off:!\"xset b off&\"",
  126. X"Click Loud:!\"xset c 8&\"",
  127. X"Click Soft:!\"xset c on&\"",
  128. X"Click Off:!\"xset c off&\"",
  129. X"Lock On:!\"xset l on&\"",
  130. X"Lock Off:!\"xset l off&\"",
  131. X"Mouse Fast:!\"xset m 4 2&\"",
  132. X"Mouse Normal:!\"xset m 2 5&\"",
  133. X"Mouse Slow:!\"xset m 1 1&\"",
  134. X"}",
  135. X"f.newiconify=m:w|i:delta l",
  136. X"f.raise=m:w|i:delta l",
  137. X"f.lower=m:w|i:l u",
  138. X"f.raise=m:w:m d",
  139. X"f.resize=m:w:delta m",
  140. X"f.iconify=m:i:m u",
  141. X"f.raise=m:w|i:r d",
  142. X"f.move=m:w|i:delta r",
  143. X"f.circledown=m:r:l d",
  144. X"f.circleup=m:r:r d",
  145. X"f.circledown=m|s::l d",
  146. X"f.menu=:r:m d:\"WindowOps\"",
  147. X"f.menu=m|s::m d:\"WindowOps\"",
  148. X"f.menu=m|s::m d:\"Preferences\"",
  149. X"f.circleup=m|s::r d",
  150. X"f.iconify=m|c:w|i:l d",
  151. X"f.newiconify=m|l:w|i:l d",
  152. X"f.raise=m|l:w|i:l u",
  153. X"f.pushright=m|l:w|i:r d",
  154. X"f.pushleft=m|c:w|i:r d",
  155. X"f.pushup=m|l:w|i:m d",
  156. X"f.pushdown=m|c:w|i:m d",
  157. X0    /* Must NOT be removed. */
  158. X};
  159. END_OF_FILE
  160. if test 3728 -ne `wc -c <'Bindings.c'`; then
  161.     echo shar: \"'Bindings.c'\" unpacked with wrong size!
  162. fi
  163. # end of 'Bindings.c'
  164. fi
  165. if test -f 'Error.c' -a "${1}" != "-c" ; then 
  166.   echo shar: Will not clobber existing file \"'Error.c'\"
  167. else
  168. echo shar: Extracting \"'Error.c'\" \(3042 characters\)
  169. sed "s/^X//" >'Error.c' <<'END_OF_FILE'
  170. X
  171. X
  172. X
  173. X#ifndef lint
  174. Xstatic char *rcsid_Error_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Error.c,v 1.1 89/01/23 15:34:11 jkh Exp $";
  175. X#endif    lint
  176. X
  177. X#include <signal.h>
  178. X#include "X11/copyright.h"
  179. X/*
  180. X *
  181. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  182. X *
  183. X * Copyright 1987 by Jordan Hubbard.
  184. X *
  185. X *
  186. X *                         All Rights Reserved
  187. X *
  188. X * Permission to use, copy, modify, and distribute this software and its
  189. X * documentation for any purpose and without fee is hereby granted,
  190. X * provided that the above copyright notice appear in all copies and that
  191. X * both that copyright notice and this permission notice appear in
  192. X * supporting documentation, and that the name of Ardent Computer
  193. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  194. X * pertaining to distribution of the software without specific, written
  195. X * prior permission.
  196. X *
  197. X */
  198. X
  199. X/*
  200. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  201. X *
  202. X *                         All Rights Reserved
  203. X *
  204. X * Permission to use, copy, modify, and distribute this software and its
  205. X * documentation for any purpose and without fee is hereby granted,
  206. X * provided that the above copyright notice appear in all copies and that
  207. X * both that copyright notice and this permission notice appear in
  208. X * supporting documentation, and that the name of Digital Equipment
  209. X * Corporation not be used in advertising or publicity pertaining to
  210. X * distribution of the software without specific, written prior permission.
  211. X *
  212. X *
  213. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  214. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  215. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  216. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  217. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  218. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  219. X * SOFTWARE.
  220. X */
  221. X
  222. X
  223. X
  224. X/*
  225. X * MODIFICATION HISTORY
  226. X *
  227. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  228. X * 1.3 -- Cleanup. Fixed bug.
  229. X */
  230. X
  231. X#ifndef lint
  232. Xstatic char *sccsid = "@(#)Error.c    3.8    1/24/86";
  233. X#endif
  234. X
  235. X#ifdef titan
  236. X#include <unistd.h>
  237. X#endif
  238. X
  239. X#include "awm.h"
  240. X
  241. Xextern Boolean desktop_execd;
  242. Xextern char execfile[];
  243. X
  244. X/*
  245. X * Default error reporting routine.  Called when a random awm error
  246. X * is encountered.
  247. X */
  248. XError(s)
  249. Xchar *s;    /* Error description string */
  250. X{
  251. X    Entry("Error")
  252. X
  253. X    fprintf(stderr, "awm: %s\n", s);
  254. X    if (!desktop_execd) {
  255. X     if (access(execfile, X_OK) == 0) {
  256. X          if (fork() == 0) {
  257. X#ifdef SYSV
  258. X           setpgrp();
  259. X#else
  260. X           setpgrp(0, getpid());
  261. X#endif
  262. X           signal(SIGHUP, SIG_DFL);
  263. X           signal(SIGQUIT, SIG_DFL);
  264. X           signal(SIGINT, SIG_DFL);
  265. X           execl("/bin/sh", "sh", "-c", execfile, 0);
  266. X           _exit(127);
  267. X          }
  268. X          else
  269. X           desktop_execd = TRUE;
  270. X     }
  271. X    }
  272. X    Cleanup();
  273. X    exit(1);
  274. X}
  275. X
  276. Xvoid Warning(s)
  277. Xchar *s;    /* Error description string */
  278. X{
  279. X    Entry("Warning")
  280. X
  281. X    fprintf(stderr, "awm: warning: %s\n", s);
  282. X    Leave_void
  283. X}
  284. END_OF_FILE
  285. if test 3042 -ne `wc -c <'Error.c'`; then
  286.     echo shar: \"'Error.c'\" unpacked with wrong size!
  287. fi
  288. # end of 'Error.c'
  289. fi
  290. if test -f 'Focus.c' -a "${1}" != "-c" ; then 
  291.   echo shar: Will not clobber existing file \"'Focus.c'\"
  292. else
  293. echo shar: Extracting \"'Focus.c'\" \(3290 characters\)
  294. sed "s/^X//" >'Focus.c' <<'END_OF_FILE'
  295. X
  296. X
  297. X
  298. X#ifndef lint
  299. Xstatic char *rcsid_Focus_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Focus.c,v 1.2 89/02/07 20:04:46 jkh Exp $";
  300. X#endif    lint
  301. X
  302. X
  303. X#include "X11/copyright.h"
  304. X/*
  305. X *
  306. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  307. X *
  308. X * Copyright 1987 by Jordan Hubbard.
  309. X *
  310. X *
  311. X *                         All Rights Reserved
  312. X *
  313. X * Permission to use, copy, modify, and distribute this software and its
  314. X * documentation for any purpose and without fee is hereby granted,
  315. X * provided that the above copyright notice appear in all copies and that
  316. X * both that copyright notice and this permission notice appear in
  317. X * supporting documentation, and that the name of Ardent Computer
  318. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  319. X * pertaining to distribution of the software without specific, written
  320. X * prior permission.
  321. X *
  322. X */
  323. X
  324. X/*
  325. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  326. X *
  327. X *                         All Rights Reserved
  328. X *
  329. X * Permission to use, copy, modify, and distribute this software and its
  330. X * documentation for any purpose and without fee is hereby granted,
  331. X * provided that the above copyright notice appear in all copies and that
  332. X * both that copyright notice and this permission notice appear in
  333. X * supporting documentation, and that the name of Digital Equipment
  334. X * Corporation not be used in advertising or publicity pertaining to
  335. X * distribution of the software without specific, written prior permission.
  336. X *
  337. X *
  338. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  339. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  340. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  341. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  342. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  343. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  344. X * SOFTWARE.
  345. X */
  346. X
  347. X
  348. X
  349. X/*
  350. X * MODIFICATION HISTORY
  351. X *
  352. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  353. X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
  354. X    Western Software Lab. Converted to X11.
  355. X */
  356. X
  357. X#ifndef lint
  358. Xstatic char *sccsid = "@(#)Focus.c    3.8    1/24/86";
  359. X#endif
  360. X
  361. X#include "awm.h"
  362. X
  363. Xextern Window FocusWindow;
  364. X
  365. X/*ARGSUSED*/
  366. XBoolean Focus(window, mask, button, x, y)
  367. XWindow window;                /* Event window. */
  368. Xint mask;                /* Button/key mask. */
  369. Xint button;                /* Button event detail. */
  370. Xint x, y;                /* Event mouse position. */
  371. X{
  372. X     AwmInfoPtr awi;
  373. X
  374. X     Entry("Focus");
  375. X
  376. X     awi = GetAwmInfo(window);
  377. X     if (awi)
  378. X      window = awi->client;
  379. X     XSetInputFocus(dpy, window, RevertToPointerRoot, CurrentTime);
  380. X     if (window != RootWindow(dpy, scr))
  381. X      FocusSetByUser = TRUE;
  382. X     else
  383. X      FocusSetByUser = FALSE;
  384. X     FocusSetByWM = FALSE;
  385. X     FocusWindow = window;
  386. X     Leave(FALSE)
  387. X}
  388. X
  389. X/*ARGSUSED*/
  390. XBoolean UnFocus(window, mask, button, x, y)
  391. XWindow window;                /* Event window. */
  392. Xint mask;                /* Button/key mask. */
  393. Xint button;                /* Button event detail. */
  394. Xint x, y;                /* Event mouse position. */
  395. X{
  396. X     Entry("UnFocus");
  397. X
  398. X     XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
  399. X     FocusSetByUser = FALSE;
  400. X     FocusSetByWM = FALSE;
  401. X     FocusWindow = RootWindow(dpy, scr);
  402. X     Leave(FALSE)
  403. X}
  404. X
  405. END_OF_FILE
  406. if test 3290 -ne `wc -c <'Focus.c'`; then
  407.     echo shar: \"'Focus.c'\" unpacked with wrong size!
  408. fi
  409. # end of 'Focus.c'
  410. fi
  411. if test -f 'Menu.c' -a "${1}" != "-c" ; then 
  412.   echo shar: Will not clobber existing file \"'Menu.c'\"
  413. else
  414. echo shar: Extracting \"'Menu.c'\" \(4421 characters\)
  415. sed "s/^X//" >'Menu.c' <<'END_OF_FILE'
  416. X
  417. X
  418. X
  419. X#ifndef lint
  420. Xstatic char *rcsid_Menu_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Menu.c,v 1.3 89/02/07 22:39:41 jkh Exp $";
  421. X#endif    lint
  422. X
  423. X#include "X11/copyright.h"
  424. X/*
  425. X *
  426. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  427. X *
  428. X * Copyright 1987 by Jordan Hubbard.
  429. X *
  430. X *
  431. X *                         All Rights Reserved
  432. X *
  433. X * Permission to use, copy, modify, and distribute this software and its
  434. X * documentation for any purpose and without fee is hereby granted,
  435. X * provided that the above copyright notice appear in all copies and that
  436. X * both that copyright notice and this permission notice appear in
  437. X * supporting documentation, and that the name of Ardent Computer
  438. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  439. X * pertaining to distribution of the software without specific, written
  440. X * prior permission.
  441. X *
  442. X */
  443. X
  444. X#include <signal.h>
  445. X#include "X11/cursorfont.h"
  446. X
  447. X/*
  448. X * MODIFICATION HISTORY
  449. X *
  450. X * 000 -- J.Hubbard, Ardent Computer.
  451. X *     This file bears little resemblance to its former namesake.
  452. X *    Because of massive changes to support RTL menus, the Menu()
  453. X *      function is now little more than a bootstrap for RTL.
  454. X * 1.2 -- Select_Window code fixed for icons.
  455. X */
  456. X
  457. X#ifndef lint
  458. Xstatic char *sccsid = "@(#)Menu.c    3.8    1/24/86";
  459. X#endif
  460. X
  461. X#include "awm.h"
  462. X
  463. X/*ARGSUSED*/
  464. XBoolean DoMenu(window, mask, button, x, y, menu)
  465. XWindow window;                /* Event window. */
  466. Xint mask;                /* Button/key mask. */
  467. Xint button;                /* Button event detail. */
  468. Xint x, y;                /* Event mouse position. */
  469. XRTLMenu menu;
  470. X{
  471. X     RTLPoint pos;
  472. X     
  473. X     Entry("DoMenu")
  474. X      
  475. X     pos.x = x;
  476. X     pos.y = y;
  477. X     if (!menu)
  478. X    Leave(FALSE)
  479. X     RTLMenu_Enter(menu, button, 0, window, pos);
  480. X     Leave(TRUE)
  481. X}
  482. X
  483. X/*ARGSUSED*/
  484. XBoolean DoAction(window, mask, button, x, y, menu, action)
  485. XWindow window;                /* Event window. */
  486. Xint mask;                /* Button/key mask. */
  487. Xint button;                /* Button event detail. */
  488. Xint x, y;                /* Event mouse position. */
  489. XRTLMenu menu;
  490. XActionLine *action;
  491. X{
  492. X     char *buff, *cmd;
  493. X     int status, pid, w;
  494. X     void (*istat)(), (*qstat)();
  495. X
  496. X     Entry("DoAction")
  497. X
  498. X     switch(action->type) {
  499. X     case IsText:
  500. X      XStoreBytes(dpy, action->text, strlen(action->text));
  501. X      break;
  502. X
  503. X     case IsTextNL:
  504. X      buff = (char *)malloc(strlen(action->text) + 2);
  505. X      strcpy(buff, action->text);
  506. X      strcat(buff, "\n");
  507. X      XStoreBytes(dpy, buff, strlen(buff));
  508. X      free(buff);
  509. X      break;
  510. X
  511. X     case IsShellCommand:
  512. X      cmd = action->text;
  513. X      if ((pid = fork()) == 0) {
  514. X           setpgrp(0, getpid());
  515. X           signal(SIGHUP, SIG_DFL);
  516. X           signal(SIGQUIT, SIG_DFL);
  517. X           signal(SIGINT, SIG_DFL);
  518. X           execl("/bin/sh", "sh", "-c", cmd, 0);
  519. X           _exit(127);
  520. X      }
  521. X      istat = (void (*)())signal(SIGINT, SIG_IGN);
  522. X      qstat = (void (*)())signal(SIGQUIT, SIG_IGN);
  523. X      while ((w = wait(&status)) != pid && w != -1);
  524. X      if (w == -1)
  525. X           status = -1;
  526. X      signal(SIGINT, istat);
  527. X      signal(SIGQUIT, qstat);
  528. X      break;
  529. X
  530. X     default:
  531. X      fprintf(stderr, "awm: Warning: Unknown action type %d (%s) invoked\n",
  532. X          action->type, action->text);
  533. X      break;
  534. X     }
  535. X}
  536. X
  537. X/*
  538. X * Routine to let user select a window using the mouse
  539. X */
  540. X
  541. XWindow Select_Window(x, y, button)
  542. Xint *x, *y, *button;
  543. X{
  544. X     XEvent event;
  545. X     Window target_win, root;
  546. X     int root_x, root_y, x2, y2;
  547. X     unsigned int ptrmask;
  548. X     AwmInfoPtr awi;
  549. X     
  550. X     Entry("Select_Window")
  551. X      
  552. X     /* Make the target cursor */
  553. X     if (XGrabPointer( dpy, RootWindow(dpy, scr),
  554. X              TRUE, (unsigned int) EVENTMASK, GrabModeAsync,
  555. X              GrabModeAsync, None,
  556. X              TargetCursor, CurrentTime )
  557. X     != GrabSuccess ) {
  558. X      fprintf(stderr, "awm (Select_Window): Can't grab the mouse.");
  559. X      Leave(RootWindow(dpy, scr))
  560. X     }
  561. X     Snatched = TRUE;
  562. X     /* Select a window */
  563. X     while (TRUE) {
  564. X      XPeekEvent(dpy, &event);
  565. X      if (event.type != ButtonPress) {
  566. X           GetButton(&event);
  567. X           continue;
  568. X      }
  569. X          XNextEvent(dpy, &event);
  570. X      XQueryPointer(dpy, RootWindow(dpy, scr), &root,
  571. X            &target_win, &root_x, &root_y, &x2, &y2, &ptrmask);
  572. X
  573. X      *x = root_x;
  574. X      *y = root_y;
  575. X      *button = event.xbutton.button;
  576. X      if (target_win == 0)
  577. X           target_win = event.xbutton.window;
  578. X      XUngrabPointer(dpy, CurrentTime);      /* Done with pointer */
  579. X      if (awi = GetAwmInfo(target_win))
  580. X           if (target_win != awi->icon)
  581. X                    target_win = (awi->frame) ? awi->frame : awi->client;
  582. X      Snatched = FALSE;
  583. X      Leave(target_win)
  584. X     }
  585. X}
  586. END_OF_FILE
  587. if test 4421 -ne `wc -c <'Menu.c'`; then
  588.     echo shar: \"'Menu.c'\" unpacked with wrong size!
  589. fi
  590. # end of 'Menu.c'
  591. fi
  592. if test -f 'Raise.c' -a "${1}" != "-c" ; then 
  593.   echo shar: Will not clobber existing file \"'Raise.c'\"
  594. else
  595. echo shar: Extracting \"'Raise.c'\" \(3717 characters\)
  596. sed "s/^X//" >'Raise.c' <<'END_OF_FILE'
  597. X
  598. X
  599. X
  600. X#ifndef lint
  601. Xstatic char *rcsid_Raise_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Raise.c,v 1.2 89/02/07 21:23:28 jkh Exp $";
  602. X#endif  lint
  603. X
  604. X#include "X11/copyright.h"
  605. X/*
  606. X *
  607. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  608. X *
  609. X * Copyright 1987 by Jordan Hubbard.
  610. X *
  611. X *
  612. X *                         All Rights Reserved
  613. X *
  614. X * Permission to use, copy, modify, and distribute this software and its
  615. X * documentation for any purpose and without fee is hereby granted,
  616. X * provided that the above copyright notice appear in all copies and that
  617. X * both that copyright notice and this permission notice appear in
  618. X * supporting documentation, and that the name of Ardent Computer
  619. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  620. X * pertaining to distribution of the software without specific, written
  621. X * prior permission.
  622. X *
  623. X */
  624. X
  625. X/*
  626. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  627. X *
  628. X *                         All Rights Reserved
  629. X *
  630. X * Permission to use, copy, modify, and distribute this software and its
  631. X * documentation for any purpose and without fee is hereby granted,
  632. X * provided that the above copyright notice appear in all copies and that
  633. X * both that copyright notice and this permission notice appear in
  634. X * supporting documentation, and that the name of Digital Equipment
  635. X * Corporation not be used in advertising or publicity pertaining to
  636. X * distribution of the software without specific, written prior permission.
  637. X *
  638. X *
  639. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  640. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  641. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  642. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  643. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  644. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  645. X * SOFTWARE.
  646. X */
  647. X
  648. X
  649. X/*
  650. X * MODIFICATION HISTORY
  651. X *
  652. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  653. X * 001 -- R. Kittell, DEC Storage A/D May 19, 1986
  654. X *  Optionally warp mouse to upper right corner of window after raise.
  655. X * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
  656. X *  Western Software Lab. Convert to X11.
  657. X * 003 -- Jordan Hubbard, Ardent Computer
  658. X *  Changed for awm.
  659. X */
  660. X
  661. X#include "awm.h"
  662. X
  663. X/*ARGSUSED*/
  664. XBoolean Raise(window, mask, button, x, y)
  665. XWindow window;                          /* Event window. */
  666. Xint mask;                               /* Button/key mask. */
  667. Xint button;                               /* Button event detail. */
  668. Xint x, y;                               /* Event mouse position. */
  669. X
  670. X{
  671. X     XWindowAttributes winfo;            /* Window details for warp */
  672. X     AwmInfoPtr awi;
  673. X     int status, vpoint;
  674. X     
  675. X     Entry("Raise")
  676. X     
  677. X     /*
  678. X      * If the window is not the root window, raise the window and return.
  679. X      */
  680. X
  681. X     awi = GetAwmInfo(window);
  682. X     if (!awi)
  683. X      Leave(FALSE)
  684. X     if (window != RootWindow(dpy, scr)) {
  685. X      window = awi->frame ? awi->frame : awi->client;
  686. X      XRaiseWindow(dpy, window);
  687. X      if (awi->frame)
  688. X           vpoint = 10 + titleHeight + 2;
  689. X      else
  690. X           vpoint = 10;
  691. X      /*
  692. X       * Optionally warp the mouse to the upper left corner of the window.
  693. X       */
  694. X      if (WarpOnRaise) {
  695. X           status = XGetWindowAttributes (dpy, window, &winfo);
  696. X           if (status == FAILURE)
  697. X            Leave(FALSE)
  698. X           
  699. X           status = XWarpPointer (dpy, None, window, 
  700. X                      0, 0, 0, 0,
  701. X                      winfo.width >= 7 ? winfo.width - 7 :
  702. X                      winfo.width / 2,
  703. X                      winfo.height >= vpoint ? vpoint :
  704. X                      winfo.height / 2);
  705. X           if (status == FAILURE)
  706. X            Leave(FALSE)
  707. X      }
  708. X     }
  709. X     Leave(FALSE)
  710. X}
  711. END_OF_FILE
  712. if test 3717 -ne `wc -c <'Raise.c'`; then
  713.     echo shar: \"'Raise.c'\" unpacked with wrong size!
  714. fi
  715. # end of 'Raise.c'
  716. fi
  717. if test -f 'Refresh.c' -a "${1}" != "-c" ; then 
  718.   echo shar: Will not clobber existing file \"'Refresh.c'\"
  719. else
  720. echo shar: Extracting \"'Refresh.c'\" \(4452 characters\)
  721. sed "s/^X//" >'Refresh.c' <<'END_OF_FILE'
  722. X
  723. X
  724. X
  725. X#ifndef lint
  726. Xstatic char *rcsid_Refresh_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Refresh.c,v 1.2 89/02/07 21:23:32 jkh Exp $";
  727. X#endif    lint
  728. X
  729. X#include "X11/copyright.h"
  730. X/*
  731. X *
  732. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  733. X *
  734. X * Copyright 1987 by Jordan Hubbard.
  735. X *
  736. X *
  737. X *                         All Rights Reserved
  738. X *
  739. X * Permission to use, copy, modify, and distribute this software and its
  740. X * documentation for any purpose and without fee is hereby granted,
  741. X * provided that the above copyright notice appear in all copies and that
  742. X * both that copyright notice and this permission notice appear in
  743. X * supporting documentation, and that the name of Ardent Computer
  744. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  745. X * pertaining to distribution of the software without specific, written
  746. X * prior permission.
  747. X *
  748. X */
  749. X
  750. X/*
  751. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  752. X *
  753. X *                         All Rights Reserved
  754. X *
  755. X * Permission to use, copy, modify, and distribute this software and its
  756. X * documentation for any purpose and without fee is hereby granted,
  757. X * provided that the above copyright notice appear in all copies and that
  758. X * both that copyright notice and this permission notice appear in
  759. X * supporting documentation, and that the name of Digital Equipment
  760. X * Corporation not be used in advertising or publicity pertaining to
  761. X * distribution of the software without specific, written prior permission.
  762. X *
  763. X *
  764. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  765. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  766. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  767. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  768. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  769. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  770. X * SOFTWARE.
  771. X */
  772. X
  773. X
  774. X/*
  775. X * MODIFICATION HISTORY
  776. X *
  777. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  778. X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
  779. X *  Western Software Lab. Convert to X11.
  780. X * 002 -- Jordan Hubbard, Ardent Computer
  781. X *  Changes for awm.
  782. X */
  783. X
  784. X#include "awm.h"
  785. X
  786. X/*ARGSUSED*/
  787. XBoolean Refresh(window, mask, button, x, y)
  788. XWindow window;                          /* Event window. */
  789. Xint mask;                               /* Button/key mask. */
  790. Xint button;                           /* Button event detail. */
  791. Xint x, y;                               /* Event mouse position. */
  792. X{
  793. X    Entry("Refresh")
  794. X
  795. X#ifdef titan
  796. X    XTitanReset(dpy);
  797. X#endif /* titan */
  798. X    Leave( Redraw(RootWindow(dpy,scr), mask, button, x, y) )
  799. X}
  800. X
  801. X
  802. X
  803. X/*ARGSUSED*/
  804. XBoolean Redraw(window, mask, button, x, y)
  805. XWindow window;                          /* Event window. */
  806. Xint mask;                               /* Button/key mask. */
  807. Xint button;                             /* Button event detail. */
  808. Xint x, y;                               /* Event mouse position. */
  809. X{
  810. X    XWindowAttributes winfo;        /* window info. */
  811. X    XSetWindowAttributes swa;        /* New window info */
  812. X    Window w;                /* Refresh window. */
  813. X
  814. X    Entry("Redraw")
  815. X
  816. X    /*
  817. X     * Get info on the target window.
  818. X     */
  819. X    status = XGetWindowAttributes(dpy, window, &winfo);
  820. X    if (status == FAILURE)
  821. X     Error("Refresh -> Can't query target window.");
  822. X    /*
  823. X     * Create and map a window which covers the target window, then destroy it.
  824. X     */
  825. X    swa.override_redirect = TRUE;
  826. X    swa.background_pixel = 0;
  827. X
  828. X    /*
  829. X     * What we have here is a failure to communicate. This window should
  830. X     * more properly be created as a subwindow of "window", but
  831. X     * when we do that, all events (Create, Map, Destroy) get reported
  832. X     * as coming from "window", not the newly created one. This is
  833. X     * very nasty when the DestroyNotify is received. For now, we'll
  834. X     * create it on the RootWindow and take the chance of generating an
  835. X     * expose on an overlapping window.
  836. X     */
  837. X    if ((w = XCreateWindow(dpy, RootWindow(dpy, scr), winfo.x, winfo.y, 
  838. X               (unsigned int) winfo.width, 
  839. X               (unsigned int) winfo.height, (unsigned int) 0,
  840. X               DefaultDepth(dpy, scr),
  841. X               CopyFromParent,
  842. X               DefaultVisual(dpy, scr),
  843. X               (CWOverrideRedirect | CWBackPixel),
  844. X               &swa)) == NULL)
  845. X     Error("Refresh -> Can't create refresh window.");
  846. X    XMapWindow(dpy, w);
  847. X    XDestroyWindow(dpy, w);
  848. X    XFlush(dpy);
  849. X    Leave(FALSE)
  850. X}
  851. END_OF_FILE
  852. if test 4452 -ne `wc -c <'Refresh.c'`; then
  853.     echo shar: \"'Refresh.c'\" unpacked with wrong size!
  854. fi
  855. # end of 'Refresh.c'
  856. fi
  857. if test -f 'Restart.c' -a "${1}" != "-c" ; then 
  858.   echo shar: Will not clobber existing file \"'Restart.c'\"
  859. else
  860. echo shar: Extracting \"'Restart.c'\" \(5197 characters\)
  861. sed "s/^X//" >'Restart.c' <<'END_OF_FILE'
  862. X
  863. X
  864. X
  865. X#ifndef lint
  866. Xstatic char *rcsid_Restart_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Restart.c,v 1.3 89/02/07 22:39:52 jkh Exp $";
  867. X#endif  lint
  868. X
  869. X#include "X11/copyright.h"
  870. X/*
  871. X *
  872. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  873. X *
  874. X * Copyright 1987 by Jordan Hubbard.
  875. X *
  876. X *
  877. X *                         All Rights Reserved
  878. X *
  879. X * Permission to use, copy, modify, and distribute this software and its
  880. X * documentation for any purpose and without fee is hereby granted,
  881. X * provided that the above copyright notice appear in all copies and that
  882. X * both that copyright notice and this permission notice appear in
  883. X * supporting documentation, and that the name of Ardent Computer
  884. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  885. X * pertaining to distribution of the software without specific, written
  886. X * prior permission.
  887. X *
  888. X */
  889. X
  890. X/*
  891. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  892. X *
  893. X *                         All Rights Reserved
  894. X *
  895. X * Permission to use, copy, modify, and distribute this software and its
  896. X * documentation for any purpose and without fee is hereby granted,
  897. X * provided that the above copyright notice appear in all copies and that
  898. X * both that copyright notice and this permission notice appear in
  899. X * supporting documentation, and that the name of Digital Equipment
  900. X * Corporation not be used in advertising or publicity pertaining to
  901. X * distribution of the software without specific, written prior permission.
  902. X *
  903. X *
  904. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  905. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  906. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  907. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  908. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  909. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  910. X * SOFTWARE.
  911. X */
  912. X
  913. X/*
  914. X * MODIFICATION HISTORY
  915. X *
  916. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  917. X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
  918. X    Western Software Lab. Convert to X11.
  919. X * 002 -- Jordan Hubbard, U.C. Berkeley. Titlebar cleanup code.
  920. X */
  921. X
  922. X#include "awm.h"
  923. X#include "X11/Xutil.h"
  924. X
  925. Xextern XContext AwmContext;
  926. X
  927. X/*ARGSUSED*/
  928. XBoolean Restart(window, mask, button, x, y)
  929. XWindow window;                          /* Event window. */
  930. Xint mask;                               /* Button/key mask. */
  931. Xint button;                             /* Button event detail. */
  932. Xint x, y;                               /* Event mouse position. */
  933. X{
  934. X    Entry("Restart")
  935. X
  936. X    XFreeFont(dpy, IFontInfo);
  937. X    XFreeFont(dpy, PFontInfo);
  938. X    XBell(dpy, VOLUME_PERCENTAGE(Volume));
  939. X    XBell(dpy, VOLUME_PERCENTAGE(Volume));
  940. X    XFlush(dpy);
  941. X    Cleanup();
  942. X    XSync(dpy, 0); /* be paranoid */
  943. X    execvp(*Argv, Argv, Environ);
  944. X    fprintf(stderr, "awm: Restart failed!\n");
  945. X    exit(1);
  946. X}
  947. X
  948. X/*ARGSUSED*/
  949. XBoolean Quit(window, mask, button, x, y)
  950. XWindow window;                          /* Event window. */
  951. Xint mask;                               /* Button/key mask. */
  952. Xint button;                             /* Button event detail. */
  953. Xint x, y;                               /* Event mouse position. */
  954. X{
  955. X     Entry("Quit")
  956. X
  957. X     Cleanup();
  958. X     /*
  959. X      * Be a careful boy scout.
  960. X      */
  961. X     XSync(dpy, 0);
  962. X     XCloseDisplay(dpy);
  963. X     exit(0);
  964. X}
  965. X
  966. X/*ARGSUSED*/
  967. XBoolean DestroyClient(window, mask, button, x, y)
  968. XWindow window;
  969. Xint mask;
  970. Xint x, y;
  971. X{
  972. X     AwmInfoPtr awi;
  973. X
  974. X     Entry("DestroyClient")
  975. X
  976. X     if (window == RootWindow(dpy, scr))
  977. X        Leave(FALSE)
  978. X     awi = GetAwmInfo(window);
  979. X     /*
  980. X      * If it's a titled window or an icon (we don't want to nuke ourselves)
  981. X      * we should get the client for it. We assume the subsequent destroy
  982. X      * notify will tell us to reclaim our resources.
  983. X      */
  984. X     window = awi->client;
  985. X     XKillClient(dpy, window);
  986. X     Leave(TRUE)
  987. X}
  988. X
  989. X/*
  990. X * Put any necessary cleanup code here, it will be invoked when awm exits
  991. X * or restarts. Currently just checks for title bar resources.
  992. X */
  993. XCleanup()
  994. X{
  995. X     Window junk, *windows;
  996. X     unsigned int nwins;
  997. X     AwmInfoPtr awi;
  998. X
  999. X     Entry("Cleanup");
  1000. X
  1001. X     if (XQueryTree(dpy, DefaultRootWindow(dpy), &junk, &junk, &windows,
  1002. X            &nwins)) {
  1003. X      int i;
  1004. X      
  1005. X      for (i = 0; i < (int)nwins; i++) {
  1006. X           XWindowAttributes xwa;
  1007. X           int bw;
  1008. X
  1009. X           awi = GetAwmInfo(windows[i]);
  1010. X           if (!awi)
  1011. X            continue;
  1012. X           bw = awi->border_width;
  1013. X           if (awi->state & ST_ICON)
  1014. X            XMapWindow(dpy, awi->client);
  1015. X           RemoveIcon(windows[i]);
  1016. X           XGetWindowAttributes(dpy, awi->frame, &xwa);
  1017. X           if (PushDown == FALSE) {
  1018. X            if (awi->attrs & AT_TITLE)
  1019. X             xwa.y += (titleHeight + 2);
  1020. X            else if (awi->attrs & AT_BORDER)
  1021. X             xwa.y += BContext;
  1022. X           }
  1023. X           if (awi->attrs & AT_BORDER)
  1024. X            xwa.x -= (BContext + (bw ? bw : 1));
  1025. X           XReparentWindow(dpy, awi->client, RootWindow(dpy, scr),
  1026. X                   xwa.x, xwa.y);
  1027. X           XRemoveFromSaveSet(dpy, awi->client);
  1028. X           XSetWindowBorderWidth(dpy, awi->client, awi->border_width);
  1029. X           free(awi);
  1030. X      }
  1031. X      if (nwins)
  1032. X           XFree(windows);
  1033. X     }
  1034. X     Leave_void
  1035. X}
  1036. END_OF_FILE
  1037. if test 5197 -ne `wc -c <'Restart.c'`; then
  1038.     echo shar: \"'Restart.c'\" unpacked with wrong size!
  1039. fi
  1040. # end of 'Restart.c'
  1041. fi
  1042. if test -f 'StoreZap.c' -a "${1}" != "-c" ; then 
  1043.   echo shar: Will not clobber existing file \"'StoreZap.c'\"
  1044. else
  1045. echo shar: Extracting \"'StoreZap.c'\" \(3788 characters\)
  1046. sed "s/^X//" >'StoreZap.c' <<'END_OF_FILE'
  1047. X
  1048. X
  1049. X
  1050. X#ifndef lint
  1051. Xstatic char *rcsid_StoreZap_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/StoreZap.c,v 1.1 89/01/23 15:34:55 jkh Exp $";
  1052. X#endif    lint
  1053. X
  1054. X#include "X11/copyright.h"
  1055. X/*
  1056. X *
  1057. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  1058. X *
  1059. X * Copyright 1987 by Jordan Hubbard.
  1060. X *
  1061. X *
  1062. X *                         All Rights Reserved
  1063. X *
  1064. X * Permission to use, copy, modify, and distribute this software and its
  1065. X * documentation for any purpose and without fee is hereby granted,
  1066. X * provided that the above copyright notice appear in all copies and that
  1067. X * both that copyright notice and this permission notice appear in
  1068. X * supporting documentation, and that the name of Ardent Computer
  1069. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  1070. X * pertaining to distribution of the software without specific, written
  1071. X * prior permission.
  1072. X *
  1073. X */
  1074. X
  1075. X/*
  1076. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  1077. X *
  1078. X *                         All Rights Reserved
  1079. X *
  1080. X * Permission to use, copy, modify, and distribute this software and its
  1081. X * documentation for any purpose and without fee is hereby granted,
  1082. X * provided that the above copyright notice appear in all copies and that
  1083. X * both that copyright notice and this permission notice appear in
  1084. X * supporting documentation, and that the name of Digital Equipment
  1085. X * Corporation not be used in advertising or publicity pertaining to
  1086. X * distribution of the software without specific, written prior permission.
  1087. X *
  1088. X *
  1089. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  1090. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  1091. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  1092. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  1093. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  1094. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  1095. X * SOFTWARE.
  1096. X */
  1097. X
  1098. X
  1099. X/*
  1100. X * MODIFICATION HISTORY
  1101. X *
  1102. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  1103. X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
  1104. X    Western Software Lab. Convert to X11.
  1105. X */
  1106. X
  1107. X/*
  1108. X *    StoreZap - This subroutine is used by the X Window Manager (xwm)
  1109. X *    to store the vertices for the iconify, uniconify zap.
  1110. X *
  1111. X */
  1112. X
  1113. X#include "awm.h"
  1114. X
  1115. X/*
  1116. X * Store the vertices for the zap effect.
  1117. X */
  1118. Xint StoreZap(zap, ulx_1, uly_1, lrx_1, lry_1, ulx_2, uly_2, lrx_2, lry_2)
  1119. X    register XSegment zap[];
  1120. X    int ulx_1;        /* From window, upper left X coordinate. */
  1121. X    int uly_1;        /* From window, upper left Y coordinate. */
  1122. X    int lrx_1;        /* From window, lower right X coordinate. */
  1123. X    int lry_1;        /* From window, lower right Y coordinate. */
  1124. X    int ulx_2;        /* To window, upper left X coordinate. */
  1125. X    int uly_2;        /* To window, upper left Y coordinate. */
  1126. X    int lrx_2;        /* To window, lower right X coordinate. */
  1127. X    int lry_2;        /* To window, lower right Y coordinate. */
  1128. X{
  1129. X
  1130. X    Entry("StoreZap")
  1131. X
  1132. X    /*
  1133. X     * Xor in.
  1134. X     */
  1135. X    zap[0].x1 = ulx_1;    zap[0].y1 = uly_1;
  1136. X    zap[0].x2 = ulx_2;    zap[0].y2 = uly_2;
  1137. X
  1138. X    zap[1].x1 = lrx_1;    zap[1].y1 = uly_1;
  1139. X    zap[1].x2 = lrx_2;    zap[1].y2 = uly_2;
  1140. X
  1141. X    zap[2].x1 = lrx_1;    zap[2].y1 = lry_1;
  1142. X    zap[2].x2 = lrx_2;    zap[2].y2 = lry_2;
  1143. X
  1144. X    zap[3].x1 = ulx_1;    zap[3].y1 = lry_1;
  1145. X    zap[3].x2 = ulx_2;    zap[3].y2 = lry_2;
  1146. X
  1147. X    /*
  1148. X     * Xor out.
  1149. X     */
  1150. X    zap[4].x1 = ulx_1;    zap[4].y1 = uly_1;
  1151. X    zap[4].x2 = ulx_2;    zap[4].y2 = uly_2;
  1152. X
  1153. X    zap[5].x1 = lrx_1;    zap[5].y1 = uly_1;
  1154. X    zap[5].x2 = lrx_2;    zap[5].y2 = uly_2;
  1155. X
  1156. X    zap[6].x1 = lrx_1;    zap[6].y1 = lry_1;
  1157. X    zap[6].x2 = lrx_2;    zap[6].y2 = lry_2;
  1158. X
  1159. X    zap[7].x1 = ulx_1;    zap[7].y1 = lry_1;
  1160. X    zap[7].x2 = ulx_2;    zap[7].y2 = lry_2;
  1161. X    /*
  1162. X     * Total number of vertices is 8.
  1163. X     */
  1164. X    Leave(8)
  1165. X}
  1166. END_OF_FILE
  1167. if test 3788 -ne `wc -c <'StoreZap.c'`; then
  1168.     echo shar: \"'StoreZap.c'\" unpacked with wrong size!
  1169. fi
  1170. # end of 'StoreZap.c'
  1171. fi
  1172. if test -f 'bitmaps/xterm.bm' -a "${1}" != "-c" ; then 
  1173.   echo shar: Will not clobber existing file \"'bitmaps/xterm.bm'\"
  1174. else
  1175. echo shar: Extracting \"'bitmaps/xterm.bm'\" \(3798 characters\)
  1176. sed "s/^X//" >'bitmaps/xterm.bm' <<'END_OF_FILE'
  1177. X/*****************************************************************************/
  1178. X/**       Copyright 1988 by Evans & Sutherland Computer Corporation,        **/
  1179. X/**                          Salt Lake City, Utah                           **/
  1180. X/**                                                                         **/
  1181. X/**                           All Rights Reserved                           **/
  1182. X/**                                                                         **/
  1183. X/**    Permission to use, copy, modify, and distribute this software and    **/
  1184. X/**    its documentation  for  any  purpose  and  without  fee is hereby    **/
  1185. X/**    granted, provided that the above copyright notice appear  in  all    **/
  1186. X/**    copies and that both  that  copyright  notice  and  this  permis-    **/
  1187. X/**    sion  notice appear in supporting  documentation,  and  that  the    **/
  1188. X/**    name  of Evans & Sutherland  not be used in advertising or publi-    **/
  1189. X/**    city pertaining to distribution  of the software without  specif-    **/
  1190. X/**    ic, written prior permission.                                        **/
  1191. X/**                                                                         **/
  1192. X/**    EVANS  & SUTHERLAND  DISCLAIMS  ALL  WARRANTIES  WITH  REGARD  TO    **/
  1193. X/**    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILI-    **/
  1194. X/**    TY AND FITNESS, IN NO EVENT SHALL EVANS &  SUTHERLAND  BE  LIABLE    **/
  1195. X/**    FOR  ANY  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY  DAM-    **/
  1196. X/**    AGES  WHATSOEVER RESULTING FROM  LOSS OF USE,  DATA  OR  PROFITS,    **/
  1197. X/**    WHETHER   IN  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS    **/
  1198. X/**    ACTION, ARISING OUT OF OR IN  CONNECTION  WITH  THE  USE  OR PER-    **/
  1199. X/**    FORMANCE OF THIS SOFTWARE.                                           **/
  1200. X/*****************************************************************************/
  1201. X
  1202. X#define xterm_width 48
  1203. X#define xterm_height 48
  1204. Xstatic char xterm_bits[] = {
  1205. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x00,
  1206. X   0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, 0xfe, 0xff, 0xff, 0x1f, 0x05,
  1207. X   0x20, 0x01, 0x00, 0x00, 0x20, 0x09, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x11,
  1208. X   0xa0, 0xfc, 0xff, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1209. X   0xa0, 0xfc, 0x01, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1210. X   0xa0, 0xfc, 0xff, 0x3f, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1211. X   0xa0, 0xfc, 0x03, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1212. X   0xa0, 0xfc, 0xff, 0x01, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1213. X   0xa0, 0xfc, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1214. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1215. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1216. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1217. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x11,
  1218. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x11, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x09,
  1219. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x09, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x05,
  1220. X   0x20, 0x01, 0x00, 0x00, 0x20, 0x05, 0x20, 0xfe, 0xff, 0xff, 0x1f, 0x03,
  1221. X   0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x00,
  1222. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1223. X   0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x03,
  1224. X   0xa0, 0xaa, 0xaa, 0xaa, 0x2a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x80, 0x02,
  1225. X   0x50, 0x55, 0x55, 0x55, 0x95, 0x02, 0x08, 0x00, 0x00, 0x00, 0x40, 0x02,
  1226. X   0xa8, 0xaa, 0xaa, 0xaa, 0x4a, 0x02, 0x04, 0x00, 0x00, 0x00, 0x20, 0x01,
  1227. X   0xb4, 0xff, 0xff, 0xff, 0xad, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00,
  1228. X   0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  1229. END_OF_FILE
  1230. if test 3798 -ne `wc -c <'bitmaps/xterm.bm'`; then
  1231.     echo shar: \"'bitmaps/xterm.bm'\" unpacked with wrong size!
  1232. fi
  1233. # end of 'bitmaps/xterm.bm'
  1234. fi
  1235. if test -f 'exp_path.c' -a "${1}" != "-c" ; then 
  1236.   echo shar: Will not clobber existing file \"'exp_path.c'\"
  1237. else
  1238. echo shar: Extracting \"'exp_path.c'\" \(3462 characters\)
  1239. sed "s/^X//" >'exp_path.c' <<'END_OF_FILE'
  1240. X
  1241. X
  1242. X
  1243. X#ifndef lint
  1244. Xstatic char *rcsid_exp_path_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/exp_path.c,v 1.2 89/02/07 21:24:42 jkh Exp $";
  1245. X#endif  lint
  1246. X
  1247. X#include "X11/copyright.h"
  1248. X/*
  1249. X *
  1250. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  1251. X *
  1252. X * Copyright 1987 by Jordan Hubbard.
  1253. X *
  1254. X *
  1255. X *                         All Rights Reserved
  1256. X *
  1257. X * Permission to use, copy, modify, and distribute this software and its
  1258. X * documentation for any purpose and without fee is hereby granted,
  1259. X * provided that the above copyright notice appear in all copies and that
  1260. X * both that copyright notice and this permission notice appear in
  1261. X * supporting documentation, and that the name of Ardent Computer
  1262. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  1263. X * pertaining to distribution of the software without specific, written
  1264. X * prior permission.
  1265. X *
  1266. X */
  1267. X
  1268. X#if defined(PCS) || defined(titan)
  1269. X#include <unistd.h>
  1270. X#endif
  1271. X#include <pwd.h>
  1272. X#include <stdio.h>
  1273. X#include "awm.h"
  1274. X
  1275. X/*
  1276. X * WARNING: This code is obscure.
  1277. X * Modify at your Own Risk.
  1278. X */
  1279. Xchar *expand_file(s)
  1280. Xregister char *s;
  1281. X{
  1282. X     static char tmp[256], *cp, err[80];
  1283. X
  1284. X     Entry("expand_file")
  1285. X     
  1286. X     /* zero tmp */
  1287. X     tmp[0] = 0;
  1288. X     if (*s == '/')
  1289. X      Leave(s)
  1290. X     if (*s == '~') {
  1291. X      if (s[1] == '/') { /* It's $HOME */
  1292. X           if (!(cp = (char *)getenv("HOME"))) {
  1293. X            sprintf(err, "expand: Can't find $HOME!\n");
  1294. X            yywarn(err);
  1295. X            Leave(0)
  1296. X           }
  1297. X           strcpy(tmp, cp);
  1298. X           strcat(tmp, s + 1);
  1299. X           Leave(tmp)
  1300. X      }
  1301. X      else { /* it's another user */
  1302. X           struct passwd *pwd;
  1303. X           char uname[32];
  1304. X           int i;
  1305. X
  1306. X           for (i = 1; s[i] != '/'; i++)
  1307. X            uname[i - 1] = s[i];
  1308. X           uname[i] = '\0';
  1309. X           pwd = getpwnam(uname);
  1310. X           if (!pwd) {
  1311. X            sprintf(err, "expand: user '%s' not found.\n", uname);
  1312. X            yywarn(err);
  1313. X            Leave(0)
  1314. X           }
  1315. X           strcpy(tmp, pwd->pw_dir);
  1316. X           strcat(tmp, s + i);
  1317. X           Leave(tmp)
  1318. X      }
  1319. X     }
  1320. X     else
  1321. X      Leave(s)
  1322. X}
  1323. X
  1324. Xchar *deblank(s)
  1325. Xregister char *s;
  1326. X{
  1327. X     Entry("deblank")
  1328. X
  1329. X     if (!s)
  1330. X      Leave(s)
  1331. X     while (*s && (*s == ' ' || *s == '\t'))
  1332. X      s++;
  1333. X     Leave(s)
  1334. X}
  1335. X
  1336. Xchar *expand_from_path(s)
  1337. Xregister char *s;
  1338. X{
  1339. X     char tmp[256], *tm;
  1340. X     int i, plen;
  1341. X
  1342. X     Entry("expand_from_path")
  1343. X
  1344. X     tmp[0] = '\0';
  1345. X     s = deblank(s);
  1346. X     if (!s || !*s)
  1347. X      Leave(0)
  1348. X     s = expand_file(s);
  1349. X     if (!s)
  1350. X      Leave(0)
  1351. X     if (!access(s, R_OK))
  1352. X      Leave(s)
  1353. X     /*
  1354. X      * If it starts with a slash, we know it either expanded and couldn't
  1355. X      * be found, or that it started with a slash in the first place and
  1356. X      * just plain couldn't be found.
  1357. X      */
  1358. X     if (*s == '/')
  1359. X      Leave(0)
  1360. X     /*
  1361. X      * At this stage we haven't found the file by name, so it's time to
  1362. X      * search the path.
  1363. X      */
  1364. X     if (!awmPath || !*awmPath)
  1365. X      Leave(0)
  1366. X     plen = strlen(awmPath);
  1367. X     i = 0;
  1368. X     while (1) {
  1369. X      int p, l;
  1370. X      
  1371. X      tmp[0] = '\0';
  1372. X      while (i < plen && awmPath[i] == ' ' || awmPath[i] == '\t')
  1373. X           i++;
  1374. X      for (p = i; p < plen && awmPath[p] != ' ' && awmPath[p] != '\t'; p++)
  1375. X           tmp[p - i] = awmPath[p];
  1376. X      if (!*tmp)
  1377. X           Leave(0)
  1378. X      tmp[p - i] = '\0';
  1379. X      i = p;
  1380. X      tm = expand_file(tmp);
  1381. X      if (!tm || !*tm)
  1382. X           continue;
  1383. X      l = strlen(tm);
  1384. X      if (l < 1)
  1385. X           continue;
  1386. X      if (tm[l - 1] != '/') { /* append / if necessary */
  1387. X           tm[l] = '/';
  1388. X           tm[++l] = '\0';
  1389. X      }
  1390. X      strcat(tm, s);
  1391. X      if (!access(tm, R_OK))
  1392. X           Leave(tm)
  1393. X     }
  1394. X}
  1395. END_OF_FILE
  1396. if test 3462 -ne `wc -c <'exp_path.c'`; then
  1397.     echo shar: \"'exp_path.c'\" unpacked with wrong size!
  1398. fi
  1399. # end of 'exp_path.c'
  1400. fi
  1401. if test -f 'menus/dbug.h' -a "${1}" != "-c" ; then 
  1402.   echo shar: Will not clobber existing file \"'menus/dbug.h'\"
  1403. else
  1404. echo shar: Extracting \"'menus/dbug.h'\" \(5217 characters\)
  1405. sed "s/^X//" >'menus/dbug.h' <<'END_OF_FILE'
  1406. X
  1407. X/************************************************************************
  1408. X *                                    *
  1409. X *            Copyright (c) 1984, Fred Fish            *
  1410. X *                All Rights Reserved                *
  1411. X *                                    *
  1412. X *    This software and/or documentation is released into the        *
  1413. X *    public domain for personal, non-commercial use only.        *
  1414. X *    Limited rights to use, modify, and redistribute are hereby    *
  1415. X *    granted for non-commercial purposes, provided that all        *
  1416. X *    copyright notices remain intact and all changes are clearly    *
  1417. X *    documented.  The author makes no warranty of any kind with    *
  1418. X *    respect to this product and explicitly disclaims any implied    *
  1419. X *    warranties of merchantability or fitness for any particular    *
  1420. X *    purpose.                            *
  1421. X *                                    *
  1422. X ************************************************************************
  1423. X */
  1424. X
  1425. X
  1426. X/*
  1427. X *  FILE
  1428. X *
  1429. X *    dbug.h    user include file for programs using the dbug package
  1430. X *
  1431. X *  SYNOPSIS
  1432. X *
  1433. X *    #include <local/dbug.h>
  1434. X *
  1435. X *  SCCS ID
  1436. X *
  1437. X *    @(#)dbug.h    1.6 10/3/85
  1438. X *
  1439. X *  DESCRIPTION
  1440. X *
  1441. X *    Programs which use the dbug package must include this file.
  1442. X *    It contains the appropriate macros to call support routines
  1443. X *    in the dbug runtime library.
  1444. X *
  1445. X *    To disable compilation of the macro expansions define the
  1446. X *    preprocessor symbol "DBUG_OFF".  This will result in null
  1447. X *    macros expansions so that the resulting code will be smaller
  1448. X *    and faster.  (The difference may be smaller than you think
  1449. X *    so this step is recommended only when absolutely necessary).
  1450. X *    In general, tradeoffs between space and efficiency are
  1451. X *    decided in favor of efficiency since space is seldom a
  1452. X *    problem on the new machines).
  1453. X *
  1454. X *    All externally visible symbol names follow the pattern
  1455. X *    "_db_xxx..xx_" to minimize the possibility of a dbug package
  1456. X *    symbol colliding with a user defined symbol.
  1457. X *    
  1458. X *    Because the C preprocessor will not accept macros with a variable
  1459. X *    number of arguments, there are separate DBUG_<N> macros for
  1460. X *    cases N = {0,1,...NMAX}.  NMAX is currently 5.
  1461. X *
  1462. X *  AUTHOR
  1463. X *
  1464. X *    Fred Fish
  1465. X *    (Currently employed by UniSoft Systems, Berkeley, Ca.)
  1466. X *    (415) 644-1230  ext 242
  1467. X *    ucbvax!unisoft!fnf  or  dual!unisoft!fnf
  1468. X *
  1469. X */
  1470. X
  1471. X
  1472. X/*
  1473. X *    Internally used dbug variables which must be global.
  1474. X */
  1475. X
  1476. X/* This gets the debugging package already being used by uwm */
  1477. X
  1478. X#include "../support.h"
  1479. X
  1480. X#ifndef DBUG_OFF
  1481. X    extern int _db_on_;            /* TRUE if debug currently enabled */
  1482. X    extern FILE *_db_fp_;        /* Current debug output stream */
  1483. X    extern char *_db_process_;        /* Name of current process */
  1484. X    extern int _db_keyword_ ();        /* Accept/reject keyword */
  1485. X    extern void _db_push_ ();        /* Push state, set up new state */
  1486. X    extern void _db_pop_ ();        /* Pop previous debug state */
  1487. X    extern void _db_enter_ ();        /* New user function entered */
  1488. X    extern void _db_return_ ();        /* User function return */
  1489. X    extern void _db_printf_ ();        /* Print debug output */
  1490. X    extern void _db_setjmp_ ();        /* Save debugger environment */
  1491. X    extern void _db_longjmp_ ();    /* Restore debugger environment */
  1492. X# endif
  1493. X
  1494. X
  1495. X/*
  1496. X *    These macros provide a user interface into functions in the
  1497. X *    dbug runtime support library.  They isolate users from changes
  1498. X *    in the MACROS and/or runtime support.
  1499. X *
  1500. X *    The symbols "__LINE__" and "__FILE__" are expanded by the
  1501. X *    preprocessor to the current source file line number and file
  1502. X *    name respectively.
  1503. X *
  1504. X *    WARNING ---  Because the DBUG_ENTER macro allocates space on
  1505. X *    the user function's stack, it must precede any executable
  1506. X *    statements in the user function.
  1507. X *
  1508. X */
  1509. X
  1510. X# ifdef DBUG_OFF
  1511. X#    define DBUG_ENTER(a1)
  1512. X#    define DBUG_RETURN(a1) return(a1)
  1513. X#    define DBUG_VOID_RETURN return
  1514. X#    define DBUG_EXECUTE(keyword,a1)
  1515. X#    define DBUG_2(keyword,format)
  1516. X#    define DBUG_3(keyword,format,a1)
  1517. X#    define DBUG_4(keyword,format,a1,a2)
  1518. X#    define DBUG_5(keyword,format,a1,a2,a3)
  1519. X#    define DBUG_PUSH(a1)
  1520. X#    define DBUG_POP()
  1521. X#    define DBUG_PROCESS(a1)
  1522. X#    define DBUG_FILE (stderr)
  1523. X#    define DBUG_SETJMP setjmp
  1524. X#    define DBUG_LONGJMP longjmp
  1525. X# else
  1526. X#    define DBUG_ENTER(a) \
  1527. X    auto char *_db_func_, *_db_file_; \
  1528. X    int _db_level_; \
  1529. X    _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_)
  1530. X#    define DBUG_LEAVE \
  1531. X    (_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
  1532. X#    define DBUG_RETURN(a1) return (DBUG_LEAVE, (a1))
  1533. X/*   define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}  Alternate form */
  1534. X#    define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
  1535. X#    define DBUG_EXECUTE(keyword,a1) \
  1536. X    if (_db_on_) {if (_db_keyword_ (keyword)) { a1; }}
  1537. X#    define DBUG_2(keyword,format) \
  1538. X    if (_db_on_) {_db_printf_ (__LINE__, keyword, format);}
  1539. X#    define DBUG_3(keyword,format,a1) \
  1540. X    if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1);}
  1541. X#    define DBUG_4(keyword,format,a1,a2) \
  1542. X    if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1, a2);}
  1543. X#    define DBUG_5(keyword,format,a1,a2,a3) \
  1544. X    if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1, a2, a3);}
  1545. X#    define DBUG_PUSH(a1) _db_push_ (a1)
  1546. X#    define DBUG_POP() _db_pop_ ()
  1547. X#    define DBUG_PROCESS(a1) (_db_process_ = a1)
  1548. X#    define DBUG_FILE (_db_fp_)
  1549. X#    define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
  1550. X#    define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
  1551. X# endif
  1552. END_OF_FILE
  1553. if test 5217 -ne `wc -c <'menus/dbug.h'`; then
  1554.     echo shar: \"'menus/dbug.h'\" unpacked with wrong size!
  1555. fi
  1556. # end of 'menus/dbug.h'
  1557. fi
  1558. if test -f 'menus/eventsave.c' -a "${1}" != "-c" ; then 
  1559.   echo shar: Will not clobber existing file \"'menus/eventsave.c'\"
  1560. else
  1561. echo shar: Extracting \"'menus/eventsave.c'\" \(3600 characters\)
  1562. sed "s/^X//" >'menus/eventsave.c' <<'END_OF_FILE'
  1563. X
  1564. X#ifndef lint
  1565. Xstatic char sccs_id[] = "@(#)eventsave.c    2.1 12/16/87  Siemens Corporate Research and Support, Inc.";
  1566. X#endif
  1567. X
  1568. X
  1569. X/* 
  1570. X  RTL Menu Package Version 1.0
  1571. X  by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987
  1572. X
  1573. X  eventsave.c: saves/restores the X event queue
  1574. X*/
  1575. X
  1576. X#include "X11/copyright.h"
  1577. X/*
  1578. X *
  1579. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  1580. X *
  1581. X * Copyright 1987 by Jordan Hubbard.
  1582. X *
  1583. X *
  1584. X *                         All Rights Reserved
  1585. X *
  1586. X * Permission to use, copy, modify, and distribute this software and its
  1587. X * documentation for any purpose and without fee is hereby granted,
  1588. X * provided that the above copyright notice appear in all copies and that
  1589. X * both that copyright notice and this permission notice appear in
  1590. X * supporting documentation, and that the name of Ardent Computer
  1591. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  1592. X * pertaining to distribution of the software without specific, written
  1593. X * prior permission.
  1594. X *
  1595. X */
  1596. X
  1597. X/*
  1598. X
  1599. XCopyright 1987 by
  1600. X    Siemens Corporate Research and Support, Inc., Princeton, New Jersey
  1601. X
  1602. XPermission to use, copy, modify, and distribute this software
  1603. Xand its documentation for any purpose and without fee is
  1604. Xhereby granted, provided that the above copyright notice
  1605. Xappear in all copies and that both that copyright notice and
  1606. Xthis permission notice appear in supporting documentation, and
  1607. Xthat the name of Siemens not be used in advertising or
  1608. Xpublicity pertaining to distribution of the software without
  1609. Xspecific, written prior permission.  Siemens makes no
  1610. Xrepresentations about the suitability of this software for any
  1611. Xpurpose.  It is provided "as is" without express or implied
  1612. Xwarranty.
  1613. X
  1614. X*/
  1615. X
  1616. X#include <stdio.h>
  1617. X#include "dbug.h"
  1618. X#include "X11/Xlib.h"
  1619. X
  1620. X#include "eventstack.h"
  1621. X
  1622. X
  1623. Xvoid SaveEvents(display, Stack, mask)
  1624. X    Display *display;
  1625. X    struct Ev_q **Stack;
  1626. X    unsigned long mask;     /* Save only events that match mask; */
  1627. X             /* others remain on the event queue  */
  1628. X{
  1629. X    XEvent ev;
  1630. X    int Match = 1;
  1631. X
  1632. X    Entry("SaveEvents")
  1633. X
  1634. X    while (XPending(display) && Match)
  1635. X    {
  1636. X    if (XCheckMaskEvent(display, mask, &ev))
  1637. X    {
  1638. X        DBUG_3("SaveEvents","Saving event type %d\n",ev.type);
  1639. X        PushEvent(&ev, Stack);
  1640. X    }
  1641. X    else
  1642. X        Match = False;
  1643. X    }
  1644. X    Leave_void
  1645. X}
  1646. X
  1647. Xvoid RestoreEvents(display, Stack)
  1648. X    Display *display;
  1649. X    struct Ev_q **Stack;    /* pointer to stack containing saved events */
  1650. X{
  1651. X    XEvent ev, *tmp;
  1652. X
  1653. X    Entry("RestoreEvents")
  1654. X    
  1655. X    while (!EventStackIsEmpty(Stack))
  1656. X    {
  1657. X    bcopy(&ev, tmp = PopEvent(Stack), sizeof(XEvent));
  1658. X    XPutBackEvent(display, &ev);
  1659. X    free(tmp);
  1660. X    }
  1661. X    XFlush(display);
  1662. X    Leave_void
  1663. X}
  1664. X
  1665. Xvoid DisposeEvents(display, mask)
  1666. X    Display *display;
  1667. X    unsigned long mask;     /* dispose events that match mask */
  1668. X{
  1669. X    int Match = 1;
  1670. X    XEvent ev;
  1671. X    
  1672. X    Entry("DisposeEvents")
  1673. X
  1674. X    while (XPending(display) && Match)
  1675. X    {
  1676. X    if (XCheckMaskEvent(display, mask, &ev))
  1677. X    {
  1678. X        DBUG_3("SaveEvents","Disposing event type %d\n",ev);
  1679. X    }
  1680. X    else
  1681. X        Match = False;
  1682. X    }
  1683. X    Leave_void
  1684. X}
  1685. X    
  1686. Xvoid DiscardEventStore(Stack)
  1687. X    struct Ev_q **Stack;
  1688. X{
  1689. X    Entry("DiscardEventStack")
  1690. X    
  1691. X    while (!EventStackIsEmpty(Stack))
  1692. X    {
  1693. X    (void) free(PopEvent(Stack));
  1694. X    }
  1695. X    Leave_void
  1696. X}
  1697. X
  1698. Xvoid AddEventToStore(Stack, ev)
  1699. X    struct Ev_q **Stack;
  1700. X    XEvent ev;
  1701. X{
  1702. X    Entry("AddEventToStore")
  1703. X
  1704. X    PushEvent(&ev, Stack);
  1705. X    Leave_void
  1706. X}
  1707. X
  1708. X
  1709. Xvoid RemoveEventFromStore(Stack, ev)
  1710. X    struct Ev_q **Stack;
  1711. X    XEvent *ev;
  1712. X{
  1713. X     XEvent *tmp;
  1714. X     Entry("RemoveEventFromStore")
  1715. X
  1716. X    bcopy(ev, tmp = PopEvent(Stack), sizeof(XEvent));
  1717. X    free(tmp);
  1718. X    Leave_void
  1719. X}
  1720. END_OF_FILE
  1721. if test 3600 -ne `wc -c <'menus/eventsave.c'`; then
  1722.     echo shar: \"'menus/eventsave.c'\" unpacked with wrong size!
  1723. fi
  1724. # end of 'menus/eventsave.c'
  1725. fi
  1726. if test -f 'twm.awmrc' -a "${1}" != "-c" ; then 
  1727.   echo shar: Will not clobber existing file \"'twm.awmrc'\"
  1728. else
  1729. echo shar: Extracting \"'twm.awmrc'\" \(1378 characters\)
  1730. sed "s/^X//" >'twm.awmrc' <<'END_OF_FILE'
  1731. X# $Source $
  1732. X# $Author $
  1733. X# $Header $
  1734. X#
  1735. X# This is a startup file for awm that produces a twm (using defaults)
  1736. X# lookalike (sort of) at the top level. Some semantics of resize and the icon
  1737. X# appearances are incompatable but will change in the near future.
  1738. X# The major difference in appearance you'll notice is the "bold"
  1739. X# appearance of the window. This is due to the fact that I use the "bold"
  1740. X# pixmap to tile the title window, I don't draw it on. I have to do this
  1741. X# since, unlike twm, any arbitrary number of gadgets (of any arbitrary size)
  1742. X# might be defined and it would be far too much trouble to try and draw
  1743. X# a tile in between all/some of them.
  1744. X#
  1745. X# Don't forget that you need to use twm.Xdefaults as well as this file.
  1746. X#
  1747. X
  1748. Xresetbindings
  1749. Xresetmenus
  1750. Xresetgadgets
  1751. X
  1752. Xgadget[0] = (twm.iconify.bm) ^ 1 | LeftGravity
  1753. Xgadget[1] = (twm.resize.bm) ^ 1 | RightGravity
  1754. Xgadget[2] = (twm.focus.bm) ^ 2 | RightGravity
  1755. X
  1756. X# FUNCTION    KEYS    CONTEXT        MOUSE BUTTON ACTIONS
  1757. Xf.move=            :title|icon:    middle motion
  1758. Xf.raise=        :title:        left down
  1759. Xf.raise=        :title:        left up
  1760. Xf.lower=        :title:        right down
  1761. Xf.iconify=        :g[0]:        left down
  1762. Xf.iconify=        :g[0]:        middle down
  1763. Xf.iconify=        :g[0]:        right down
  1764. Xf.iconify=        :icon:        left down
  1765. Xf.resize=        :g[1]:        left down
  1766. Xf.resize=        :g[1]:        middle down
  1767. Xf.resize=        :g[1]:        right down
  1768. Xf.focus=        :g[2]:        left down
  1769. Xf.focus=        :g[2]:        middle down
  1770. Xf.focus=        :g[2]:        right down
  1771. END_OF_FILE
  1772. if test 1378 -ne `wc -c <'twm.awmrc'`; then
  1773.     echo shar: \"'twm.awmrc'\" unpacked with wrong size!
  1774. fi
  1775. # end of 'twm.awmrc'
  1776. fi
  1777. echo shar: End of archive 10 \(of 12\).
  1778. cp /dev/null ark10isdone
  1779. MISSING=""
  1780. for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
  1781.     if test ! -f ark${I}isdone ; then
  1782.     MISSING="${MISSING} ${I}"
  1783.     fi
  1784. done
  1785. if test "${MISSING}" = "" ; then
  1786.     echo You have unpacked all 12 archives.
  1787.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1788. else
  1789.     echo You still need to unpack the following archives:
  1790.     echo "        " ${MISSING}
  1791. fi
  1792. ##  End of shell archive.
  1793. exit 0
  1794. -- 
  1795. Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
  1796. Moderator of comp.sources.x
  1797.